package cn.nabaixin.setting;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.nabaixin.R;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;
/**
 * 设置主界面
 * @author ZWH
 *
 */
public class SettingActivity extends ListActivity {
	private ListView lv;
	private SimpleAdapter sa;
	private List<Map<String, Object>> data;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		initView();
		initData();
	}

	private void initView() {
		lv = getListView();
	}

	private void initData() {
		String titles[] = new String[]{"版本 0.1", "新手帮助", "设置个人信息", "意见反馈", "同步设置", "推送服务", "注销登录", "清理缓存"};
		
		data = new ArrayList<Map<String,Object>>();
		for(int i=0; i<titles.length; i++){
			HashMap<String, Object> item = new HashMap<String, Object>();
			item.put("title", titles[i]);
			data.add(item);
		}
		
		sa = new SimpleAdapter(SettingActivity.this, data, R.layout.mine_list_item,
				new String[]{"title"}, new int[]{R.id.mine_infoTitle});
		lv.setAdapter(sa);
	}
	
}
